//
//  NetworkTool.h
//  封装AFN请求
//
//  Created by iMac_Kurt on 16/8/14.
//  Copyright © 2016年 Kurt_Qi. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>
#import "QKUserAccount.h"

// 枚举值控制请求类型
typedef enum : NSUInteger {
    GET,
    POST,
} QKNetworkRequestMethod;

@interface NetworkTool : AFHTTPSessionManager
/// 获取微博数据
///
/// @param finished 完成的回调
- (void)getStatusData:(void(^)(id result, NSError *error))finished;
/// 获取用户信息
///
/// @param account  账户模型
/// @param finished 完成回调
- (void)getUserInfoWithUid:(NSString *)uid finished:(void(^)(id result, NSError *error))finished;

/// OAuth授权的URL
@property (nonatomic, readonly) NSURL *oauthURL;
/// 获取AccessToken
///
/// @param code        OAuth授权码
- (void)loadAccessTokenWithCode:(NSString *)code finished:(void(^)(id result, NSError *error))finished;

/// 创建业务类单例
///
/// @return NetworkTool
+ (instancetype)sharedTools;
/// 封装AFN请求网络的方法
- (void)request:(QKNetworkRequestMethod)method URLString:(NSString *)URLString parameters:(id)params result:(void (^)(id result, NSError *error))result;
@end
